// Element Plus 组件二次封装统一导出
import MyElButton from './ElButton.vue'
import MyElInput from './ElInput.vue'
import MyElTable from './ElTable.vue'
import MyElForm from './ElForm.vue'
import MyElCard from './ElCard.vue'
import MyElTree from './ElTree.vue'
import MyElSelect from './ElSelect.vue'
import MyElDialog from './ElDialog.vue'
import MyElDatePicker from './ElDatePicker.vue'
import MyElUpload from './ElUpload.vue'
import MyElTag from './ElTag.vue'
import MyElSwitch from './ElSwitch.vue'
import MyElCheckbox from './ElCheckbox.vue'
import MyElRadio from './ElRadio.vue'

// 组件列表
const components = [
  MyElButton,
  MyElInput,
  MyElTable,
  MyElForm,
  MyElCard,
  MyElTree,
  MyElSelect,
  MyElDialog,
  MyElDatePicker,
  MyElUpload,
  MyElTag,
  MyElSwitch,
  MyElCheckbox,
  MyElRadio
]

// 安装函数
const install = function(app) {
  components.forEach(component => {
    app.component(component.name, component)
  })
}

// 自动安装
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  install,
  MyElButton,
  MyElInput,
  MyElTable,
  MyElForm,
  MyElCard,
  MyElTree,
  MyElSelect,
  MyElDialog,
  MyElDatePicker,
  MyElUpload,
  MyElTag,
  MyElSwitch,
  MyElCheckbox,
  MyElRadio
}

export {
  MyElButton,
  MyElInput,
  MyElTable,
  MyElForm,
  MyElCard,
  MyElTree,
  MyElSelect,
  MyElDialog,
  MyElDatePicker,
  MyElUpload,
  MyElTag,
  MyElSwitch,
  MyElCheckbox,
  MyElRadio
} 